
import java.util.*;

class Circle{
    double r;
    Circle(double r){
        this.r = r;
    }
    public double area() throws CircleException{
        if(r<0){
            throw new CircleException("圆半径为"+r+"不合理");
        }
        return 3.14*r*r;
    }
}

class CircleException extends Exception{
    public CircleException(String message){
        super(message);
    }

    public void print(){
        System.out.println(getMessage());
    }
}
public class Main6 {

    public static void main(String[] args) {
        double s=0;
        Scanner sc=new Scanner(System.in);
        double r1,r2;
        r1=sc.nextDouble();
        r2=sc.nextDouble();
        Circle c1=new Circle(r1);
        Circle c2=new Circle(r2);
        try{
            s = c1.area();
            System.out.println(s);
            s = c2.area();
            System.out.println(s);
        }
        catch (CircleException e){
            e.print();
        }
    }
}

